# @Time  : 2021/7/30 17:22
# @Author: zhanfengzhen
# @Email : zhanfengzhen@126.com
# @File  : app_page.py
# !/usr/bin/env python
# -*- coding: UTF-8 -*-
from appium import webdriver
from hogwarts.HogwartsHomework.appWork2.po.main_page import MainPage

#app操作类
class AppPage(object):
    #启动app
    def star_app(self):
        caps = {}
        caps["platformName"] = "Android"
        caps["appPackage"] = "com.tencent.wework"
        caps["appActivity"] = ".launch.LaunchSplashActivity"
        caps["deviceName"] = "ceshi"
        caps["noReset"] = "true"
        caps["ensureWebviewsHavePages"] = True
        self.driver = webdriver.Remote("http://localhost:7555/wd/hub", caps)
        self.driver.implicitly_wait(5)

    def restart_app(self):
        pass

    def close_app(self):
        pass

    def goto_MainPage(self):
        return MainPage(self.driver)